<html>
    <body>
        <h2>Fibonacci Testing</h2>
        <div>
            <input type="text" id="input" size="20" value="45"/>
        </div>
        <div>
            <button type="button" onclick="compute()">compute</button>
        </div>
        <div>
        <input type="text" id="output" size="40"/>
        </div>
    
    <script>
    var Module = {};
    var script = document.createElement('script');

    fetch("fibonacci.wasm")
        .then(response => response.arrayBuffer())
        .then(bytes => {
            Module.wasmBinary = bytes;
            script.src = 'fibonacci.js';
            document.body.appendChild(script)
        });

    script.onload = function() {
        const num = 45;
        var begin = new Date();
        Module["asm"]["_fib"](num);
        
        document.getElementById("output").value="result: " + res.toString() +  " spent: "+ (end- begin).toString() + "ms";

    }

  
    </script>
    </body>
</html>